﻿using Prism.Ioc;
using Prism.Unity;
using System.Configuration;
using System.Data;
using System.Windows;

namespace Zhy.PrismDialog
{
    /// <summary>
    /// 程序启动类
    /// </summary>
    public partial class App : PrismApplication
    {
        /// <summary>
        /// 提供主窗口的对象
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        protected override Window CreateShell()
        {
            // 注册主窗口对象实例
            return Container.Resolve<MainWindow>();
        }

        /// <summary>
        /// 业务中所有需要注入的对象，在这个方法里注册
        /// </summary>
        /// <param name="containerRegistry"></param>
        /// <exception cref="NotImplementedException"></exception>
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            // 注册弹窗内容
            //containerRegistry.RegisterDialog<UCDetail>();  // 如果没有自定义名称，就使用页面默认名称
            containerRegistry.RegisterDialog<UCDetail>("AAAA");
            // 注册弹窗窗口，这句代码会将框架内的默认弹窗窗口替换掉
            containerRegistry.RegisterDialogWindow<DialogParent>();
            containerRegistry.RegisterDialogWindow<DialogParent>("Dialog1"); // 注册带名称的弹窗窗体
        }
    }

}
